home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Metric.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-09
|
1KB
|
76 lines
#ifndef Metric_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Metric_First
#include "Point.h"
class Metric {
public:
Point extent;
int base;
public:
Metric();
Metric(Point e, int b);
Metric(Point e);
Metric(int w);
Metric(int w, int h);
Metric(int w, int h, int b);
Metric(const Metric&);
Point Extent()
{ return extent; }
int Width()
{ return extent.x; }
int Height()
{ return extent.y; }
int Base()
{ return base; }
Metric Inset(Point);
Metric Expand(Point);
Metric Merge(const Metric&);
Metric Cat(Direction d, const Metric &m, const Point &gap);
operator Point()
{ return extent; }
friend Metric HCat(const Metric&, const Metric&, int hgap= 0);
friend Metric VCat(const Metric&, const Metric&, int vgap= 0);
friend Metric Cat(Direction d, const Metric&, const Metric&, Point gap);
friend bool operator== (const Metric &m1, const Metric &m2)
{ return (bool) (m1.extent == m2.extent && m1.base == m2.base); }
friend bool operator!= (const Metric &m1, const Metric &m2)
{ return (bool) (m1.extent != m2.extent && m1.base != m2.base); }
friend Metric Min (const Metric&, const Metric&);
friend Metric Max (const Metric&, const Metric&);
friend OStream& operator<< (OStream &s, const Metric &p);
friend IStream& operator>> (IStream &s, Metric &p);
};
SimpleMetaDef(Metric);
#endif